import axios from '@/libs/api.request'
// 登录
export const login = ({ userName, password, roletype }) => {
  const data = {
    username: userName,
    password,
    roletype
  }
  return axios.request({
    url: '/apidl/base/login',
    data,
    method: 'post'
  })
}
// 获取对应用户信息 登录接口已返回用户信息，故当前请求无用
export const getUserInfo = (token) => {
  return axios.request({
    url: 'get_info',
    params: {
      token
    },
    method: 'get'
  })
}
// 登出
export const logout = (token) => {
  const data = {
    auth_key: token
  }
  return axios.request({
    url: '/apidl/base/logout',
    method: 'post',
    data
  })
}
